package com.atguigu.day18.lambda04.l2;

import org.junit.Test;

import java.util.Map;
import java.util.function.Supplier;

public class SupplierTest {
    @Test
    public void test02(){
/*
        Supplier<Double> s = new Supplier<Double>() {
            @Override
            public Double get() {
                return Math.random();
            }
        };
        */
        //Supplier<Double> s = ()-> Math.random();
        Supplier<Double> s = Math::random;


        Double v = s.get();
        System.out.println("v = " + v);


    }


    @Test
    public void test01(){

     /*   Supplier<String> s = new Supplier<String>() {
            @Override
            public String get() {
                return "杨幂";
            }
        };*/
        Supplier<String> s = ()-> "赵丽颖";

        String value = s.get();
        System.out.println("value = " + value);

    }
}
